package com.mingqi.enetconnected.view.Dialog.tree;

import java.util.ArrayList;
import java.util.List;

/**
 * @author yaxi
 * @date 2018/9/18
 */
public class TreeDataSource {


    public static List<TreeData> getDatas(TreeData parentData, int parentLevel) {
        ArrayList<TreeData> datas = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            TreeData treeData = new TreeData();
            treeData.setDataLevel(parentLevel + 1);

            if (parentData == null) {
                treeData.setShowLeft("level" + treeData.getDataLevel() + ">" + i);
            } else {
                treeData.setShowLeft(parentData.getShowLeft() + "|" + "level" + treeData.getDataLevel() + ">" + i);
            }
            treeData.setLevelName("level" + treeData.getDataLevel());

            if (parentLevel == 2) {
                treeData.setLastLevel(true);
                treeData.setShowRight("right" + i + ".00");
            }

            datas.add(treeData);
        }

        return datas;
    }


}
